extends Area2D

@onready var game_manager: Node = %GameManager
@onready var animation_player: AnimationPlayer = $AnimationPlayer

# 当节点第一次进入场景树时调用
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	# print("I'm a coin.")
	pass # Replace with function body.


# 调用每一帧。‘delta’是从上一帧开始经过的时间
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass


func _on_body_entered(body: Node2D) -> void:
	print("+1 coin!")
	game_manager.add_point()
	# 移除场景
	# queue_free()
	animation_player.play("pickup")
	pass # Replace with function body.
